package fr.appliClient.server.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "ASSURANCE")
public class Insurance implements AbstractEntity<Long>, Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id_assurance")
	private Long id;

	@Column(name = "nom")
	private String name;

	@Column(name = "date_fin_engagement")
	@Temporal(TemporalType.DATE)
	private Date engagementEndDate;

	@Column(name = "cout")
	private float cost;

	@Column(name = "numero")
	private int number;

	@OneToMany(mappedBy = "insurance")
	private List<Vehicle> vehicles;

	public String getName() {

		return name;
	}

	public void setName(String name) {

		this.name = name;
	}

	public Date getEngagementEndDate() {

		return engagementEndDate;
	}

	public void setEngagementEndDate(Date engagementEndDate) {

		this.engagementEndDate = engagementEndDate;
	}

	public float getCost() {

		return cost;
	}

	public void setCost(float cost) {

		this.cost = cost;
	}

	public int getNumber() {

		return number;
	}

	public void setNumber(int number) {

		this.number = number;
	}

	public List<Vehicle> getVehicles() {

		return vehicles;
	}

	public void setVehicles(List<Vehicle> vehicles) {

		this.vehicles = vehicles;
	}

	public Long getId() {

		return id;
	}

}
